package com.haiyou.sdk.rank;

import java.io.Serializable;

import com.haiyou.common.entity.Entity;
import com.haiyou.common.util.string.StringFormatUitls;

import lombok.Getter;

/**
 * 服务器级别的排行榜 基本基于玩家id 作为key
 * 
 * @author xingyuan
 * @date 2023年8月4日 下午2:42:51
 */
public abstract class AbstractServerRank<K extends Serializable & Comparable<K>, V extends Entity<?>>
		extends AbstractRank<K, V> {

	@Getter
	private int areaId;

	/**
	 * key 格式化 {keyPrefix}-{serverId}
	 */
	public static final String key_fromat = "{}-{}";

	public AbstractServerRank(int areaId, String dbType, String keyPrefix) {
		super(dbType, StringFormatUitls.format(key_fromat, keyPrefix, areaId));
		this.areaId = areaId;
	}

}
